




// type

const HOME_TYPE = 'HOME_TYPE'

const initState = {
    index: 0
}


// reducer

export function homeTypes(state=initState,action) {
    switch(action.type) {
        case 'HOME_TYPE':
            return {...state,index:action.index}
        default:
            return state
    }
} 

// action
function getidx(index) {
    return {
        type: HOME_TYPE,
        index
    }
}



export function getIndex(index) {
    return dispatch => {
        dispatch(getidx(index))
    }
}